<?php

/**
 * ContactForm class.
 * ContactForm is the data structure for keeping
 * contact form data. It is used by the 'contact' action of 'SiteController'.
 */
class Test extends ActiveRecord
{
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
	
	public function tableName()
	{
		return 'vh_hyip';
	}
	
	public function rules()
	{
		return array(
		);
	}	
        
        public function getItemsByStatus($status = "Invest")
	{
            $query = '
                    SELECT id, domain
                    FROM vh_hyip 
                    WHERE status = :status';
            
            $result = $this -> executeAll($query, array(':status' => $status), false);

            return $result;
	}
        
        public function updateTable()
	{
            $query = '
                ALTER TABLE `vh_hyip`
				ADD COLUMN `isCreditCard`  tinyint NOT NULL DEFAULT 0 AFTER `isTraceable`,
				ADD COLUMN `isPay5DaysWeekly`  tinyint NULL AFTER `isCreditCard`
            ';
            
            $result = $this -> executeNone($query);

            return $result;
	}                
}